<div id="wrapper-content" style="width: 700px;">
    <table class="titrepage" width="100%">
        <tr>
            <td >La liste des annonces</td>
            <td align="right">Total | <?php echo $count_all_ala ; ?> </td>
        </tr>
    </table>
    <table align="center" width="100%" class="list">
        <thead>
            <tr>
                <th>Images</th>
                <th>Titre</th>
                <th>Publié par</th>
                <th>Status</th>
                <th colspan="3">Action</th>
            </tr>
        </thead>
        <?php foreach($annonces as $apRow) :?>
            <?php
                $date_posted = mdate('%m/%d/%Y - %h:%i:%s', $apRow['date_posted']);
                $date_expried = mdate('%m/%d/%Y - %h:%i:%s', $apRow['date_expried']);
                $active = $apRow['active'];
                $active_status = "Désactivé";
                $img_active = root_url('animus') . 'assets/admin/images/active.png';

                $is_active = "(Active this annonce)";
                if($active == 1){
                    $active_status = "Activé";
                    $is_active = "Désactivé";
                    $img_active = root_url('animus') . 'assets/admin/images/in-active.png'; 

                }

                $image_path = "images/". $apRow['images'];
                if ($apRow['images'] != '') {
                    if (file_exists($image_path)) {
                        $image_path = base_url() . "images/". $apRow['images'];
                    } else {
                        $image_path = base_url() . "images/noimage.gif";
                    }
                } else {
                    $image_path = root_url('animus').'assets/noimage.gif';
                }
            ?>
            <tr>
                <td><img src="<?php echo $image_path; ?>" height="80px"></td>
                <td><?php echo $apRow['title'];?></td>
                <td><?php echo $apRow['username'];?></td>
                <td><?php echo $active_status; ?></td>
                 <td width="70px">
                    <a  href="<?php echo site_url('animus_admin/modifie_annonce') . '/' . $apRow['id']; ?>" >
                        <img border="0"src="<?php echo root_url('animus') . 'assets/admin/' ?>images/modifier.png"/>
                    </a>
                 </td>
                <td width="70px">
                    <a class="supprimer" href="#" ><img border="0"src="<?php echo root_url('animus') . 'assets/admin/' ?>images/supprimer.png"/></a>
                    <div style="display:none">
                        Confirmer <br/>
                        <a href="<?php echo site_url('animus_admin/delete_announce') . '/' . $apRow['id'] . '/'.$announce_type.'/' . $per_page . '/' . $off_set; ?>"> 
                            <img border="0"src="<?php echo root_url('animus') . 'assets/admin/' ?>images/oui.png"/>
                        </a>
                        <a class="non" href="#" ><img  border="0"src="<?php echo root_url('animus') . 'assets/admin/' ?>images/non.png"/></a>
                    </div>
                </td>
                <td width="70px">
                    <a  href="<?php echo  site_url('animus_admin/activation_setting/'. $apRow['id'].'/'.$announce_type.'/'.$per_page.'/'.$off_set);?>">
                        <img border="0" src="<?php echo $img_active; ?>" width="70" height="22"/>
                    </a>
                </td>
            </tr>
            <?php endforeach; ?>
    </table>
    <?php echo $pagination; ?>

</div>